package com.ebeitech.auction.http.service;

import com.ebeitech.auction.http.model.AuctionModel;

import java.util.Map;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.*;

/**
 * Created by alice on 2017/10/26.
 */
public interface HttpAuctionServiceRx {

	/**
	 * 获取首页的竞拍列表
	 * @param params
	 * param pageIndex 页数
	 * param pageSize 每页数量
	 * param startDate 开始时间 用于检索今日竞拍和即将开始
	 * param endDate 结束时间 用于检索今日竞拍和即将开始
	 * param states 竞拍状态
	 * param states 竞拍状态(多个的情况)
	 * @return
	 */
	@GET("rest/auction/findAuctionPage")
	Call<ResponseBody> doLoadTodayList(@QueryMap Map<String, String> params);

	/**
	 * app自动检查新版本
	 * @param params
	 * @return
	 */
	@GET("rest/version/check")
	Call<ResponseBody> checkVersion(@QueryMap Map<String, String> params);

	/**
	 * 我方报价
	 * @param params
	 * @return
	 */
	@POST("rest/bid/saveOurNewPrice")
	Call<ResponseBody> doAuctionOurBid(@Body Map<String, String> params);

	/**
	 * 竞方报价
	 * @param params
	 * @return
	 */
	@POST("rest/bid/saveTheirNewPrice")
	Call<ResponseBody> doAuctionTheirBid(@Body Map<String, String> params);

	/**
	 * 获取消息列表
	 * @param params
	 * @return
	 */
	@GET("rest/auction/findAuctionInitData")
	Call<ResponseBody> getMessageByWeb(@QueryMap Map<String, Object> params);

	/**
	 * 发送消息
	 * @param params
	 * @return
	 */
	@POST("rest/message/saveMessage")
	Call<ResponseBody> sendMessage(@Body Map<String, Object> params);

	/**
	 * 发送指令
	 * @param params
	 * @return
	 */
	@POST("rest/command/saveCommand")
	Call<ResponseBody> sendCommand(@Body Map<String, Object> params);

	/**
	 * 确认指令
	 * @param params
	 * @return
	 */
	@POST("rest/command/confirmCommand")
	Call<ResponseBody> confirmCommand(@Body Map<String, Object> params);

	/**
	 * 撤回指令
	 * @param params
	 * @return
	 */
	@POST("rest/bid/saveRecallBid")
	Call<ResponseBody> recallCommand(@Body Map<String, Object> params);

	/**
	 * 竞价记录列表
	 * @param auctionId
	 * @return
	 */
	@GET("rest/auctionPhase/auctionPhaseHistoriesPage")
	Call<ResponseBody> getAuctionPhaseList(@Query("auctionId") String auctionId);

	/**
	 * 进入下一个阶段
	 * @param params
	 * @return
	 */
	@POST("rest/auctionPhase/activeNextAuctionPhase")
	Call<ResponseBody> activeNextAuctionPhase(@Body Map<String, Object> params);

	/**
	 * 结束竞拍
	 * @param params
	 * @return
	 */
	@POST("rest/auctionPhase/finishAuction")
	Call<ResponseBody> finishAuction(@Body Map<String, Object> params);


	/**
	 * 最后阶段结束
	 * @param auctionId
	 * @return
	 */
	@POST("rest/auctionInfo/finalOver")
	Call<ResponseBody> finishAuctionPhase(@Query("roomId") String auctionId,
										  @Query("stageId") String phaseId,
										  @Query("result") String isGet,
										  @Query("companyId") String auctionBidderId);

	/**
	 * 微信登陆
	 * @param params
	 * @return
	 */
	@POST("rest/user/getWechatLoginInfoByCode")
	Call<ResponseBody> getWechatLogin(@Body Map<String, Object> params);

	/**
	 * 下载文件
	 * @return
	 */
	@GET
	Call<ResponseBody> downloadFile(@Url String url);

}
